domctl: relax getdomaininfo permissions
authorJan Beulich <jbeulich@suse.com>
Wed, 17 Aug 2016 13:31:56 +0000 (15:31 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 17 Aug 2016 13:31:56 +0000 (15:31 +0200)
commitd9c91ccdcd90f36418f2672c33063b9c2adfe118
treef8dd8368e51af08c0ee8579950c943841e9ccc23
parentc4e7a67e3a109a3d507d2617b77017e40d59f04a
domctl: relax getdomaininfo permissions

Qemu needs access to this for the domain it controls, both due to it
being used by xc_domain_memory_mapping() (which qemu calls) and the
explicit use in hw/xenpv/xen_domainbuild.c:xen_domain_poll(). Extend
permissions to that of any "ordinary" domctl: A domain controlling the
targeted domain can invoke this operation for that target domain (which
is being achieved by no longer passing NULL to xsm_domctl()).

This at once avoids a for_each_domain() loop when the ID of an
existing domain gets passed in.

Reported-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
tools/flask/policy/modules/xen.if
xen/common/domctl.c
xen/include/xsm/dummy.h